import 'package:json_annotation/json_annotation.dart';

part 'news.g.dart';

@JsonSerializable(nullable: false)
class News {
  final String title;
  // final List<String> imgUrls;
  final String abstract;
  final String media_name;
  final String datetime;
  final String url;
  final int comment_count;
  final bool has_image;
  final List<Map<String, dynamic>> image_list;

  News(this.title, this.abstract, this.media_name, this.datetime, this.url, this.comment_count, this.has_image, this.image_list);

  factory News.fromJson(Map<String, dynamic> json) => _$NewsFromJson(json);
  Map<String, dynamic> toJson() => _$NewsToJson(this);
}
